<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>系统主页</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    li{
      list-style: none;
    }
    a{
      text-decoration: none;
    }
    a:hover{
      color: red;
      cursor:pointer;
    }
    ul{
      height: 100px;
      background-color: #ccc;
    }
    ul li,.wel{
      line-height: 100px;
      display: inline-block;
    }

    .p1{
      font-size: 30px;
      font-weight:bolder;
      margin-left: 30px;
    }
    .p2{
      float: right;
      margin-right: 50px;
    }
    .d1,.d2{
      display: inline-block;
      height: 600px;
    }
    .d1{
      width: 19%;
      background-color: aquamarine;
      margin-left: 20px;
    }
    .d1 a{
      margin-top: 10px;
    }
    .d2{
      width: 69%;
      float: right;
      margin-right: 100px;
      border: 3px solid black;
    }
    iframe{
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>

<ul>
  <li class="p1">学生管理系统</li>
<!--  头像-->
  <img src="/getImg" style="display: inline-block; border-radius: 50%; height: 20px; width: 20px;">
  <p class="wel" id="wel" style="color: red"></p>
  <li class="p2"><a id="logout">退出登录</a></li>
</ul>
<div class="d1">
  <a href="/admin/showAll.html" style="font-size: 20px; margin-left: 100px; margin-top: 10px; margin-bottom: 10px" target="main">学生管理</a>
  <br>
  <a href="/admin/updPassword.html" style="font-size: 20px; margin-left: 100px;" target="main">修改密码</a>
</div>
<div class="d2">
  <iframe name="main" src="/admin/welcome.html"></iframe>
</div>

<script src="/js/jquery-3.6.0.js"></script>
<script>
  var username=sessionStorage.getItem("username");
  $("#wel").html("欢迎！"+username+"!");

  $("#logout").click(function () {
    $.ajax({
      url:"/admin/logout",
      type:"post",
      success:function (R) {
        if (R.code==200){
          sessionStorage.setItem("message2",R.data);
          location.href="/html/login.html"
        }
      }
    })
  })


</script>
</body>
</html>